Expression Problem
既存のコードを破壊・変更せずに拡張したい
ADT(代数データ型)だとムリ
拡張には、データ型と操作の両面がある
ざっくり、OOPLを使うかどうかに関わる
両面 同時の拡張を、可能にしたり・不可能にしたり できる
ref. enumはクローズド直和、traitはオープン直和
ref.
The Expression Problem and its solutions - Eli Bendersky's website
https://eli.thegreenplace.net/images/2016/expr-problem-clojure.png
https://www.ouarzy.com/oop-fp-and-the-expression-problem
Expression ProblemにおけるOOPと関数型の対比について - Arantium Maestum
More thoughts on the Expression Problem in Haskell - Eli Bendersky's website
Expression problem - Wikipedia
The goal is to define a data abstraction that is extensible both in its representations and its behaviors
Tweets
https://twitter.com/genkuroki/status/1402258028842323971
@genkuroki: #Julia言語 ゲームのルールはこうです。
①パッケージOを誰かが書く。
②それ以後パッケージOを書き換えてはいけない。
③別のパッケージPの中でパッケージOに型やop.を追加せよ。
スクショへの書き込みも書き換えました。
https://pbs.twimg.com/media/E3XBighVoAYa3dt.jpghttps://pbs.twimg.com/media/E3XBigiVoAMPLKD.jpghttps://pbs.twimg.com/media/E3XCUBjVcAEf-vD.jpghttps://pbs.twimg.com/media/E3XDZwHVcAEMv0i.jpghttps://pbs.twimg.com/media/E3XFcV3UUAE13YB.jpghttps://pbs.twimg.com/media/E3XFcV2VoAUEiQY.jpghttps://pbs.twimg.com/media/E3XNJdPUUAIbQQP.jpghttps://pbs.twimg.com/media/E3XN54WVIAc5FL3.jpghttps://pbs.twimg.com/media/E3XOe7NVgAI6oKo.jpghttps://pbs.twimg.com/media/E3XSPf-XEAcdqii.jpg